﻿using System;

namespace ApplicationLibrary.SqlConnector
{
    #region AM_Locks

    public class AM_Locks : Table
    {
        public static string Name = "AM_Locks";

        public static Column<string> TableName = new Column<string>(Name, "TableName", "TableName", 32, false, false);
        public static Column<string> LockKey = new Column<string>(Name, "LockKey", "LockKey", 64, false, false);
        public static Column<string> Username = new Column<string>(Name, "", "Username", 32);
        public static Column<string> ComputerName = new Column<string>(Name, "ComputerName", "ComputerName", 32);
        public static Column<DateTime> LockDate = new Column<DateTime>(Name, "LockDate", "LockDate");

        override public iColumn ForeignKey
        {
            get { return TableName; }
        }

        public AM_Locks()
        {
            Tablename = Name;
        }
    }

    #endregion

    #region AM_Version

    public class AM_Version : Table
    {
        public static string Name = "AM_Version";

        public static Column<string> Application = new Column<string>(Name, "", "Application", 32, false, false);
        public static Column<string> Module = new Column<string>(Name, "", "Module", 32, false, false);
        public static Column<int> Version = new Column<int>(Name, "", "Version");

        override public iColumn ForeignKey
        {
            get { return Module; }
        }

        public AM_Version()
        {
            Tablename = Name;
            VisibleInRadar(new iColumn[] { Module, Version });
            Tablename = Name;
            DefineKey(new iColumn[] { Application, Module });
        }
    }

    #endregion

    #region AM_Users

    public class AM_Users : Table
    {
        public static string Name = "AM_Users";

        public static Column<string> Username = new Column<string>(Name, "", "Username", 32, false, false);
        public static Column<string> Password = new Column<string>(Name, "", "Password", 64);
        public static Column<string> Surname = new Column<string>(Name, "Surname", "Surname", 32);
        public static Column<UserType> UserType = new Column<UserType>(Name, "", "UserType");
        public static Column<bool> Expired = new Column<bool>(Name, "Expired", "Expired");
        public static Column<DateTime> ExpireDate = new Column<DateTime>(Name, "ExpDate", "ExpDate");
        public static Column<bool> ChangePassword = new Column<bool>(Name, "", "ChangePassword");
        public static Column<bool> Blocked = new Column<bool>(Name, "", "Blocked");

        override public iColumn ForeignKey
        {
            get { return Username; }
        }

        public AM_Users()
        {
            Tablename = Name;
            VisibleInRadar(new iColumn[] { Username, Surname });
            Tablename = Name;
            DefineKey(new iColumn[] { Username });
        }
    }

    #endregion

    #region AM_Descriptions

    public class AM_Descriptions : Table
    {
        public static string Name = "AM_Descriptions";

        public static Column<Int32> ID = new Column<Int32>(Name, "", "ID", false, true);
        public static Column<string> Category = new Column<string>(Name, "Category", "Category", 35);
        public static Column<string> Description = new Column<string>(Name, "Description", "Description", 35);

        override public iColumn ForeignKey
        {
            get { return ID; }
        }

        public AM_Descriptions()
        {
            VisibleInRadar(new iColumn[] { ID, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { ID });
        }
    }

    #endregion

    #region AM_Counter

    public class AM_Counter : Table
    {
        public static string Name = "AM_Counter";

        public static Column<int> Year = new Column<int>(Name, "Year", "Year", false, false);
        public static Column<int> Type = new Column<int>(Name, "Type", "Type", false, false);
        public static Column<string> Description = new Column<string>(Name, "Description", "Description", 35);
        public static Column<bool> HasPrefix = new Column<bool>(Name, "HasPrefix", "HasPrefix");
        public static Column<bool> PrefixRO = new Column<bool>(Name, "PrefixRO", "PrefixRO");
        public static Column<int> PrefixLen = new Column<int>(Name, "PrefixLen", "PrefixLen");
        public static Column<string> PrefixValue = new Column<string>(Name, "PrefixValue", "PrefixValue", 4);
        public static Column<string> PrefixMask = new Column<string>(Name, "PrefixMask", "PrefixMask", 4);
        public static Column<int> PrefixType = new Column<int>(Name, "PrefixType", "PrefixType");
        public static Column<string> PrefixSep = new Column<string>(Name, "PrefixSep", "PrefixSep", 1);

        public static Column<bool> HasSuffix = new Column<bool>(Name, "HasSuffix", "HasSuffix");
        public static Column<bool> SuffixRO = new Column<bool>(Name, "SuffixRO", "SuffixRO");
        public static Column<int> SuffixLen = new Column<int>(Name, "SuffixLen", "SuffixLen");
        public static Column<string> SuffixValue = new Column<string>(Name, "SuffixValue", "SuffixValue", 4);
        public static Column<string> SuffixMask = new Column<string>(Name, "SuffixMask", "SuffixMask", 4);
        public static Column<int> SuffixType = new Column<int>(Name, "SuffixType", "SuffixType");
        public static Column<string> SuffixSep = new Column<string>(Name, "SuffixSep", "SuffixSep", 1);
        public static Column<bool> InvertSufPref = new Column<bool>(Name, "InvertSuffPref", "InvertSuffPref");

        public static Column<int> CodeType = new Column<int>(Name, "CodeType", "CodeType");
        public static Column<int> CodeLen = new Column<int>(Name, "CodeLen", "CodeLen");
        public static Column<int> CodeKey = new Column<int>(Name, "CodeKey", "CodeKey");

        override public iColumn ForeignKey
        {
            get { return Year; }
        }

        public AM_Counter()
        {
            VisibleInRadar(new iColumn[] { Year, Type, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Year, Type });
        }
    }

    #endregion

    #region AM_CounterValue

    public class AM_CounterValue : Table
    {
        public static string Name = "AM_CounterValue";

        public static Column<int> Type = new Column<int>(Name, "Type", "Type", false, false);
        public static Column<string> Code = new Column<string>(Name, "Code", "Code", 15, false, false);
        public static Column<string> Description = new Column<string>(Name, "Description", "Description", 35);
        public static Column<string> TextValue = new Column<string>(Name, "TextValue", "TextValue", 15);
        public static Column<int> NumericValue = new Column<int>(Name, "NumericValue", "NumericValue");

        override public iColumn ForeignKey
        {
            get { return Type; }
        }

        public AM_CounterValue()
        {
            Tablename = Name;
            DefineKey(new iColumn[] { Type, Code });
        }
    }

    #endregion

    #region AM_Codes

    public class AM_Codes : Table
    {
        public static string Name = "AM_Codes";
        public static Column<string> CodeType = new Column<string>(Name, "", "CodeType", 8, false, false);
        public static Column<string> Description = new Column<string>(Name, "Description", "Description", 35);

        override public iColumn ForeignKey
        {
            get { return CodeType; }
        }

        public AM_Codes()
        {
            VisibleInRadar(new iColumn[] { CodeType, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { CodeType });
        }
    }

    #endregion

    #region AM_CodeSegment

    public class AM_CodeSegment : Table
    {
        public static string Name = "AM_CodeSegment";
        public static Column<string> CodeType = new Column<string>(Name, "Type", "Type", 8, false, false);
        public static Column<int> Segment = new Column<int>(Name, "Segment", "Segment", false, false);
        public static Column<string> Description = new Column<string>(Name, "Description", "Description", 35);
        public static Column<int> InputType = new Column<int>(Name, "InputType", "InputType");
        public static Column<int> InputLen = new Column<int>(Name, "InputLen", "InputLen");

        public override iColumn ForeignKey
        {
            get { return CodeType; }
        }

        public AM_CodeSegment()
        {
            DefineKey(new iColumn[] { CodeType, Segment });
        }
    }

    #endregion

    #region AM_Preferences

    public class AM_Preferences : Table
    {
        public static string Name = "AM_Preferences";
        public static Column<string> PrefType = new Column<string>(Name, "PrefType", "PrefType", 32, false, false);
        public static Column<string> Computer = new Column<string>(Name, "Computer", "Computer", 32, false, false);
        public static Column<string> Username = new Column<string>(Name, "Username", "Username", 32, false, false);
        public static Column<string> Application = new Column<string>(Name, "ApplicationName", "ApplicationName", 32, false, false);
        public static Column<string> Preferences = new Column<string>(Name, "Preferences", "Preferences", 2048);

        public override iColumn ForeignKey
        {
            get { return Application; }
        }

        public AM_Preferences()
        {
            Tablename = Name;
            DefineKey(new iColumn[] { PrefType, Computer, Username, Application });
        }
    }

    #endregion
}